/* eslint-disable no-unused-vars */
/* eslint-disable class-methods-use-this */
/* eslint-disable import/no-cycle */
import React, { Component } from 'react';
import BaseControl from './BaseControl';

// 空控件：用于表单无控件内容，用于兼容旧表单。
class NoneControl extends BaseControl {
  static create(props, dataProps, extProps) {
    return new NoneControl(props, dataProps, extProps);
  }

  constructor(props, dataProps, extProps) {
    const dataProps2 = {
      title: '',
      type: 'None',
      ...dataProps,
    };
    super(props, dataProps2, extProps);
    this.name = '空';
    // this.icon = '';
  }

  getJsonValue(jsonValues) {
    return null;
  }

  setJsonValue(jsonValues) {}

  getPropertyTabs(parentForm) {
    return [];
  }

  getPropertyJson() {
    return {
      key: this.data.key,
      type: this.data.type,
      custom: this.data.custom,
      order: this.data.order,
    };
  }

  getDesignModelJson() {
    return this.getPropertyJson();
  }

  render(parentForm) {
    return (
      <div
        key={this.data.key}
        ref={(ref) => {
          this.domNode = ref;
        }}
        {...this.extProps}
        order={this.data.order}
      >
        {this.props.children}
      </div>
    );
  }
}

export default NoneControl;
